Skip to content

Conversation

@ljluestc
Copy link

更改内容

  • 修改 channel.go: 更新 Get() 方法,增加了对从开放通道接收 nil 连接的防御性处理逻辑。
  • 新增 channel_test.go: 添加了回归测试 TestNilConnInChannel,用于验证手动注入 nil 连接时 Get() 能够正确跳过并返回有效连接。

测试计划

  • 运行 go test -v . 以验证所有测试用例通过,包括新添加的回归测试。
  • 验证 TestNilConnInChannel 能够稳定通过。
=== RUN   TestNilConnInChannel
    channel_test.go:37: p.Get() returned: conn=valid-conn, err=<nil>
--- PASS: TestNilConnInChannel (0.00s)
PASS

@ljluestc ljluestc force-pushed the fix/issue-24-continue-on-nil branch from 240bd2e to bcbca1d Compare January 25, 2026 19:43
@ljluestc ljluestc force-pushed the fix/issue-24-continue-on-nil branch from bcbca1d to 0cfc419 Compare January 25, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant